﻿@model Zatify.WebUI.Admin.Models.ChangeUserPasswordViewModel
           
<script type="text/javascript">

    var changeUserPasswordPopUp = new PopUp("changeUserPassword_Dialog", "overlay");

    function changePassword(userId) {

        $("#formChangeUserPassword #UserID").val(userId);

        changeUserPasswordPopUp.ShowDialog(true);
    }

    $(document).ready(function () {

        $("#btnClose, #btnCancel").click(function (e) {

            $("#changeUserPassword_Dialog").find("input[type=text], input[type=password]").each(function () {
                $(this).val("");
                $(this).removeClass("input-validation-error");
            });

            $("#changeUserPassword_Dialog").find("span.field-validation-error").each(function () {
                
                $(this).removeClass("field-validation-error").addClass("field-validation-valid");
            });

            changeUserPasswordPopUp.CloseDialog();
            e.preventDefault();
        });
    })
</script>

<div id="changeUserPassword_Dialog" class="web_dialog">
    <table style="width: 100%; border: 0px;" cellpadding="3" cellspacing="0">
        <tr>
            <td class="web_dialog_title">
                Change Password
            </td>
            <td class="web_dialog_title align_right">
                <a href="#" id="btnClose">X</a>
            </td>
        </tr>
        <tr>
            <td class="dialogContent" colspan="2" style="padding-left: 15px;">
                <div>
                    @using (Html.BeginForm("ChangePassword", "Users", FormMethod.Post, new { id="formChangeUserPassword" }))
                    {
                        <fieldset>
                            <legend>
                                <h4>Change Password</h4>
                            </legend>
                            <div class="add_new_user_form">
                                @Html.HiddenFor(m => m.UserID)
                                <label class="apps_label_text">
                                    Password:</label>
                                @Html.PasswordFor(m => m.Password, new { @class = "apps_inputbox" })
                                <br />
                                <label class="apps_label_text">
                                    Confirm Password:</label>
                                @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "apps_inputbox" })
                                <div class="zatify_panel_btn">
                                    <input type="submit" value="Save" class="btn apps_btn apps_gray_btn" name="">
                                    <input id="btnCancel" type="button" value="Cancel" class="btn apps_btn apps_gray_btn" name="">
                                </div>
                            </div>
                        </fieldset>
                    }
                </div>
            </td>
        </tr>
    </table>
</div>
